<?php
$origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : '';
$allows = array(
    'http://local.doc.inkphp.net',
    'http://localhost:8080'
);
header('X-Powered-By:Brain/0.6b');
header('Server:Apache/1.3.27');
header("Content-type: application/json; charset=utf-8");
if(in_array($origin, $allows)){
    header("Access-Control-Allow-Origin:".$origin);
}
header("Access-Control-Allow-Methods:POST, GET, OPTIONS");
header("Access-Control-Allow-Headers:Content-Type, Authorization,XAuthorization,Accept,userToken,guid");
header("Access-Control-Allow-Credentials:true");
if($_SERVER['REQUEST_METHOD'] == 'OPTIONS'){@header('HTTP/1.1 204 No Content');exit;}
